<template>

    <el-row>
        <el-col :span="24">
          <vue-ueditor-wrap
            v-model="contend"
            :config="config"
            editor-id="ue1"
          ></vue-ueditor-wrap>
        </el-col>
          <el-col :span="24" style="margin-top:20px">
              <el-button type="primary" size="small" @click="submitFormData">
          提交
        </el-button>
          </el-col>
    </el-form>
  </el-row>

</template>
<script>
import { baseURL } from '@/config'
import VueUeditorWrap from 'vue-ueditor-wrap' // ES6 Module
//api
import { description, descriptionupdate } from '@/api/school'
export default {
  components: {
    VueUeditorWrap,
  },
  data() {
    return {
      contend: '',
      config: {
        initialFrameWidth: null,
        initialFrameHeight: 350,
        // UEDITOR_HOME_URL: '/UEditor/',
        UEDITOR_HOME_URL: '/UEditor/',
        serverUrl: baseURL + 'common/ueditor',
      },
      ue1: 'ue1',
    }
  },
  created() {
    this.getschoolDescription()
  },
  methods: {
    async getschoolDescription() {
      let data = await description()
      if (data.code == '0000') {
        this.contend = data.data.description
      }
    },
    async submitFormData() {
      let params = { description: this.contend }
      let data = await descriptionupdate(params)
      if (data.code == '0000') {
        this.$message.success(data.msg)
      }
    },
  },
}
</script>

<style scoped lang='scss'>
</style>